package tw.asap.plus.entity.response;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Yax.
 * Date: 15/11/14
 * Time: 上午1:59
 * Description:
 */
public class OrderDetail implements Parcelable {

    /**
     * order_sn : 订单id
     * order_status : 订单状态
     * items : [{"title":"商品名称","nums":"数量","price":"单位"}]
     * order_amount : 订单金额
     * pay_amount : 应付金额
     * pay_status : 支付状态
     * order_coupon : 订单优惠金额
     * shipping_price : 配送费用
     * order_addr : 收货地址
     * order_mobile : 手机人手机号
     * order_name : 收货人姓名
     * create_time : 创建时间
     * ship_name : 物流名称
     * contact : 商家联系方式
     */

    private String order_sn;
    private String order_status;
    private String order_amount;
    private String pay_amount;
    private String pay_status;
    private String order_coupon;
    private String shipping_price;
    private String order_addr;
    private String order_mobile;
    private String order_name;
    private String create_time;
    private String ship_name;
    private String contact;
    private String shop_name;
    /**
     * title : 商品名称
     * nums : 数量
     * price : 单位
     */

    private List<ItemsEntity> items;

    public String getShop_name() {
        return shop_name;
    }

    public void setShop_name(String shop_name) {
        this.shop_name = shop_name;
    }

    public void setOrder_sn(String order_sn) {
        this.order_sn = order_sn;
    }

    public void setOrder_status(String order_status) {
        this.order_status = order_status;
    }

    public void setOrder_amount(String order_amount) {
        this.order_amount = order_amount;
    }

    public void setPay_amount(String pay_amount) {
        this.pay_amount = pay_amount;
    }

    public void setPay_status(String pay_status) {
        this.pay_status = pay_status;
    }

    public void setOrder_coupon(String order_coupon) {
        this.order_coupon = order_coupon;
    }

    public void setShipping_price(String shipping_price) {
        this.shipping_price = shipping_price;
    }

    public void setOrder_addr(String order_addr) {
        this.order_addr = order_addr;
    }

    public void setOrder_mobile(String order_mobile) {
        this.order_mobile = order_mobile;
    }

    public void setOrder_name(String order_name) {
        this.order_name = order_name;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public void setShip_name(String ship_name) {
        this.ship_name = ship_name;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public void setItems(List<ItemsEntity> items) {
        this.items = items;
    }

    public String getOrder_sn() {
        return order_sn;
    }

    public String getOrder_status() {
        return order_status;
    }

    public String getOrder_amount() {
        return order_amount;
    }

    public String getPay_amount() {
        return pay_amount;
    }

    public String getPay_status() {
        return pay_status;
    }

    public String getOrder_coupon() {
        return order_coupon;
    }

    public String getShipping_price() {
        return shipping_price;
    }

    public String getOrder_addr() {
        return order_addr;
    }

    public String getOrder_mobile() {
        return order_mobile;
    }

    public String getOrder_name() {
        return order_name;
    }

    public String getCreate_time() {
        return create_time;
    }

    public String getShip_name() {
        return ship_name;
    }

    public String getContact() {
        return contact;
    }

    public List<ItemsEntity> getItems() {
        return items;
    }

    public static class ItemsEntity {
        private String title;
        private String nums;
        private String price;

        public void setTitle(String title) {
            this.title = title;
        }

        public void setNums(String nums) {
            this.nums = nums;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public String getTitle() {
            return title;
        }

        public String getNums() {
            return nums;
        }

        public String getPrice() {
            return price;
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.order_sn);
        dest.writeString(this.order_status);
        dest.writeString(this.order_amount);
        dest.writeString(this.pay_amount);
        dest.writeString(this.pay_status);
        dest.writeString(this.order_coupon);
        dest.writeString(this.shipping_price);
        dest.writeString(this.order_addr);
        dest.writeString(this.order_mobile);
        dest.writeString(this.order_name);
        dest.writeString(this.create_time);
        dest.writeString(this.ship_name);
        dest.writeString(this.contact);
        dest.writeString(this.shop_name);
        dest.writeList(this.items);
    }

    public OrderDetail() {
    }

    protected OrderDetail(Parcel in) {
        this.order_sn = in.readString();
        this.order_status = in.readString();
        this.order_amount = in.readString();
        this.pay_amount = in.readString();
        this.pay_status = in.readString();
        this.order_coupon = in.readString();
        this.shipping_price = in.readString();
        this.order_addr = in.readString();
        this.order_mobile = in.readString();
        this.order_name = in.readString();
        this.create_time = in.readString();
        this.ship_name = in.readString();
        this.contact = in.readString();
        this.shop_name = in.readString();
        this.items = new ArrayList<ItemsEntity>();
        in.readList(this.items, List.class.getClassLoader());
    }

    public static final Parcelable.Creator<OrderDetail> CREATOR = new Parcelable.Creator<OrderDetail>() {
        public OrderDetail createFromParcel(Parcel source) {
            return new OrderDetail(source);
        }

        public OrderDetail[] newArray(int size) {
            return new OrderDetail[size];
        }
    };
}
